#include "gtest/gtest.h"

#include "s1.hpp"

TEST(BaiLian, tEnglishNumberTranslator)
{
  //main2();
  Parer p;
  ASSERT_EQ(p.Parse("zero"), 0);
  ASSERT_EQ(p.Parse("six"), 6);
  ASSERT_EQ(p.Parse("negative seven hundred twenty nine"), -729);
  ASSERT_EQ(p.Parse("one million one hundred one"), 1000101);
  ASSERT_EQ(p.Parse("eight hundred fourteen thousand twenty two"), 814022);
  ASSERT_EQ(p.Parse("one"), 1);
  ASSERT_EQ(p.Parse("two"), 2);
  ASSERT_EQ(p.Parse("three"), 3);
  ASSERT_EQ(p.Parse("four"), 4);
  ASSERT_EQ(p.Parse("five"), 5);
  ASSERT_EQ(p.Parse("seven"), 7);
  ASSERT_EQ(p.Parse("eight"), 8);
  ASSERT_EQ(p.Parse("nine"), 9);
  ASSERT_EQ(p.Parse("ten"), 10);
  ASSERT_EQ(p.Parse("eleven"), 11);
  ASSERT_EQ(p.Parse("twelve"), 12);
  ASSERT_EQ(p.Parse("thirteen"), 13);
  ASSERT_EQ(p.Parse("fourteen"), 14);
  ASSERT_EQ(p.Parse("fifteen"), 15);
  ASSERT_EQ(p.Parse("sixteen"), 16);
  ASSERT_EQ(p.Parse("seventeen"), 17);
  ASSERT_EQ(p.Parse("eighteen"), 18);
  ASSERT_EQ(p.Parse("nineteen"), 19);
  ASSERT_EQ(p.Parse("twenty"), 20);
  ASSERT_EQ(p.Parse("thirty"), 30);
  ASSERT_EQ(p.Parse("forty one"), 41);
  ASSERT_EQ(p.Parse("fifty"), 50);
  ASSERT_EQ(p.Parse("sixty"), 60);
  ASSERT_EQ(p.Parse("seventy seven"), 77);
  ASSERT_EQ(p.Parse("eighty"), 80);
  ASSERT_EQ(p.Parse("ninety"), 90);
  ASSERT_EQ(p.Parse("one hundred three"), 103);
  ASSERT_EQ(p.Parse("negative one hundred twenty three million four hundred fifty six thousand seven hundred eighty"), -123456780);
  ASSERT_EQ(p.Parse("one hundred twenty three million four hundred fifty six thousand seven hundred eighty"), 123456780);
  ASSERT_EQ(p.Parse("nine hundred ninety nine million nine hundred ninety nine thousand nine hundred ninety nine"), 999999999);
  ASSERT_EQ(p.Parse("negative nine hundred ninety nine million nine hundred ninety nine thousand nine hundred ninety nine"), -999999999);
}